<template>
  <a-card :bordered="false">
    <!-- 操作按钮区域 -->
    <div class="table-operator">
      <a-tabs v-model="activeKey" @change="handleChangeTab">
        <a-tab-pane key="wsc" tab="未生成">
          <a-button @click="addNotice" type="primary" icon="plus">新增</a-button>
          <a-button type="primary" icon="download" @click="handleExportXls('资金运用审批单-未生成')">导出</a-button>
          <div>
            <a-table
              ref="procTable"
              size="middle"
              bordered
              rowKey="id"
              class="j-table-force-nowrap1"
              :scroll="{ x: true }"
              :columns="table1.columns"
              :dataSource="table1.dataSource"
              :pagination="table1.ipagination"
              :loading="table1.loading"
              :rowSelection="{ type: type, selectedRowKeys: table1.selectedRowKeys, onChange: onSelectChangeTab1 }"
            >
              <span slot="action" slot-scope="text, record">
              <a @click="handelFundingClose(record)">关闭</a>
            </span>
            </a-table>
          </div>
        </a-tab-pane>
        <a-tab-pane key="notGenerated" tab="暂存中">
          <a-form layout="inline" @keyup.enter.native="searchQuery">
            <a-row :gutter="2">
              <a-col :xl="8" :lg="11" :md="12" :sm="24">
                <a-form-item label="开始日期">
                  <j-date placeholder="请选择开始日期" class="query-group-cust" v-model="startTime_begin"></j-date>
                  <span class="query-group-split-cust"></span>
                  <j-date placeholder="请选择结束日期" class="query-group-cust" v-model="startTime_end"></j-date>
                </a-form-item>
              </a-col>
              <a-col :xl="6" :lg="7" :md="8" :sm="24">
                <span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
                  <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
                  <a-button type="primary" @click="searchResetUnCreated" icon="reload" style="margin-left: 8px">重置</a-button>
                </span>
              </a-col>
            </a-row>
          </a-form>
          <a-button type="primary" icon="download" @click="handleExportXls('费用申请-暂存中')">导出</a-button>
          <a-table
            ref="table"
            size="middle"
            bordered
            :rowKey="
              (record, index) => {
                return record.detailId
              }
            "
            class="j-table-force-nowrap1"
            :scroll="{ x: true }"
            :columns="columns"
            :dataSource="notGeneratedTable.dataSource"
            :pagination="notGeneratedTable.ipagination"
            :loading="notGeneratedTable.loading"
            :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
            @change="handleTableChange"
          >
            <template slot="htmlSlot" slot-scope="text">
              <div v-html="text"></div>
            </template>
            <template slot="imgSlot" slot-scope="text, record">
              <span v-if="!text" style="font-size: 12px; font-style: italic">无图片</span>
              <img
                v-else
                :src="getImgView(text)"
                :preview="record.id"
                height="25px"
                alt=""
                style="max-width: 80px; font-size: 12px; font-style: italic"
              />
            </template>
            <template slot="fileSlot" slot-scope="text">
              <span v-if="!text" style="font-size: 12px; font-style: italic">无文件</span>
              <a-button v-else :ghost="true" type="primary" icon="download" size="small" @click="downloadFile(text)">
                下载
              </a-button>
            </template>

            <span slot="action" slot-scope="text, record">
              <a @click="handleEdit(record)">编辑</a>
              <a-divider type="vertical"></a-divider>
              <act-apply-btn
                @success="loadData"
                :data-id="record.id"
                :serviceName="serviceName"
                :variables="record"
              ></act-apply-btn>
              <!--              <act-historic-detail-btn :data-id="record.id"></act-historic-detail-btn>-->
              <a-divider type="vertical" />
              <a-dropdown>
                <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
                <a-menu slot="overlay">
                  <a-menu-item>
                    <a @click="handleDetail(record)">详情</a>
                  </a-menu-item>
                  <a-menu-item>
                    <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
                      <a>删除</a>
                    </a-popconfirm>
                  </a-menu-item>
                </a-menu>
              </a-dropdown>
            </span>
          </a-table>
        </a-tab-pane>
        <a-tab-pane key="needEdit" tab="需修改">
          <a-button type="primary" icon="download" style="margin-bottom: 5px"
                    @click="handleExportXls('费用申请-需修改')">导出
          </a-button>
          <a-table
            ref="needEditTable"
            size="middle"
            bordered
            :rowKey="
              (record, index) => {
                return record.detailId
              }
            "
            class="j-table-force-nowrap1"
            :scroll="{ x: true }"
            :columns="columns"
            :dataSource="needEditTable.dataSource"
            :pagination="needEditTable.ipagination"
            :loading="needEditTable.loading"
            :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
            @change="handleTableChange"
          >
            <template slot="htmlSlot" slot-scope="text">
              <div v-html="text"></div>
            </template>
            <template slot="imgSlot" slot-scope="text, record">
              <span v-if="!text" style="font-size: 12px; font-style: italic">无图片</span>
              <img
                v-else
                :src="getImgView(text)"
                :preview="record.id"
                height="25px"
                alt=""
                style="max-width: 80px; font-size: 12px; font-style: italic"
              />
            </template>
            <template slot="fileSlot" slot-scope="text">
              <span v-if="!text" style="font-size: 12px; font-style: italic">无文件</span>
              <a-button v-else :ghost="true" type="primary" icon="download" size="small" @click="downloadFile(text)">
                下载
              </a-button>
            </template>

            <span slot="action" slot-scope="text, record">
              <a v-if="record.status < 0" @click="handleEdit(record)">编辑</a>
              <a-divider type="vertical"></a-divider>
              <act-apply-btn
                v-show="record.status < 0"
                @success="loadData"
                :data-id="record.id"
                :serviceName="serviceName"
                :variables="record"
              ></act-apply-btn>
              <act-historic-detail-btn :data-id="record.id"></act-historic-detail-btn>
              <a-divider type="vertical" />
              <a-dropdown>
                <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
                <a-menu slot="overlay">
                  <a-menu-item>
                    <a @click="handleDetail(record)">详情</a>
                  </a-menu-item>
                  <a-menu-item>
                    <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
                      <a>删除</a>
                    </a-popconfirm>
                  </a-menu-item>
                </a-menu>
              </a-dropdown>
            </span>
          </a-table>
        </a-tab-pane>
        <a-tab-pane key="approving" tab="审批中">
          <a-button type="primary" icon="download" @click="handleExportXls('费用申请-审批中')">导出</a-button>
          <a-table
            ref="approvingTable"
            size="middle"
            bordered
            :rowKey="
              (record, index) => {
                return record.detailId
              }
            "
            class="j-table-force-nowrap1"
            :scroll="{ x: true }"
            :columns="columns"
            :dataSource="approvingTable.dataSource"
            :pagination="approvingTable.ipagination"
            :loading="approvingTable.loading"
            :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
            @change="handleTableChange"
          >
            <template slot="htmlSlot" slot-scope="text">
              <div v-html="text"></div>
            </template>
            <template slot="imgSlot" slot-scope="text, record">
              <span v-if="!text" style="font-size: 12px; font-style: italic">无图片</span>
              <img
                v-else
                :src="getImgView(text)"
                :preview="record.id"
                height="25px"
                alt=""
                style="max-width: 80px; font-size: 12px; font-style: italic"
              />
            </template>
            <template slot="fileSlot" slot-scope="text">
              <span v-if="!text" style="font-size: 12px; font-style: italic">无文件</span>
              <a-button v-else :ghost="true" type="primary" icon="download" size="small" @click="downloadFile(text)">
                下载
              </a-button>
            </template>

            <span slot="action" slot-scope="text, record">
              <act-historic-detail-btn :data-id="record.id"></act-historic-detail-btn>
              <a-divider type="vertical" />
              <a-popconfirm  v-if="record.actStatus != '撤回'" title="确定取消申请吗?" @confirm="() => handelSubmitCancel(record)">
                <a href="javascript:;">取消申请</a>
              </a-popconfirm>
              <a-divider type="vertical" />
              <a-dropdown>
                <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
                <a-menu slot="overlay">
                  <a-menu-item>
                    <a @click="handleDetail(record)">详情</a>
                  </a-menu-item>
                </a-menu>
              </a-dropdown>
            </span>
          </a-table>
        </a-tab-pane>
        <a-tab-pane key="approved" tab="已审批">
          <a-button type="primary" icon="download" style="margin-bottom: 5px"
                    @click="handleExportXls('费用申请-已审批')">导出
          </a-button>
          <a-table
            ref="approvedTable"
            size="middle"
            bordered
            :rowKey="
              (record, index) => {
                return record.detailId
              }
            "
            class="j-table-force-nowrap1"
            :scroll="{ x: true }"
            :columns="columns"
            :dataSource="approvedTable.dataSource"
            :pagination="approvedTable.ipagination"
            :loading="approvedTable.loading"
            :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
            @change="handleTableChange"
          >
            <template slot="htmlSlot" slot-scope="text">
              <div v-html="text"></div>
            </template>
            <template slot="imgSlot" slot-scope="text, record">
              <span v-if="!text" style="font-size: 12px; font-style: italic">无图片</span>
              <img
                v-else
                :src="getImgView(text)"
                :preview="record.id"
                height="25px"
                alt=""
                style="max-width: 80px; font-size: 12px; font-style: italic"
              />
            </template>
            <template slot="fileSlot" slot-scope="text">
              <span v-if="!text" style="font-size: 12px; font-style: italic">无文件</span>
              <a-button v-else :ghost="true" type="primary" icon="download" size="small" @click="downloadFile(text)">
                下载
              </a-button>
            </template>

            <span slot="action" slot-scope="text, record">
              <act-historic-detail-btn :data-id="record.id"></act-historic-detail-btn>
              <a-divider type="vertical" />
              <a-dropdown>
                <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
                <a-menu slot="overlay">
                  <a-menu-item>
                    <a @click="printPreview(record)">打印预览</a>
                  </a-menu-item>
                  <a-menu-item>
                    <a @click="handleDetail(record)">详情</a>
                  </a-menu-item>
                </a-menu>
              </a-dropdown>
            </span>
          </a-table>
        </a-tab-pane>
      </a-tabs>
    </div>

    <fund-use-approval-modal ref="modalForm" @ok="modalFormOk"></fund-use-approval-modal>
  </a-card>
</template>

<script>

  import '@/assets/less/TableExpand.less'
  import { mixinDevice } from '@/utils/mixin'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import FundUseApprovalModal from './modules/FundUseApprovalModal'
  import ActApplyBtn from '@views/flowable/components/ActApplyBtn.vue'
  import ActHistoricDetailBtn from '@views/flowable/components/ActHistoricDetailBtn.vue'
  import moment from 'dayjs'
  import { deleteAction, getAction, httpAction } from '@api/manage'
  import { stopProcess } from '@views/flowable/api/process'
  import store from '@/store'

  export default {
    name: 'FundUseApprovalList',
    mixins:[JeecgListMixin, mixinDevice],
    components: {
      ActHistoricDetailBtn, ActApplyBtn,
      FundUseApprovalModal
    },
    data () {
      return {
        description: '资金运用审批单管理页面',
        serviceName: 'fundUseApprovalService',
        activeKey: 'wsc',
        type: 'radio',
        startTime_begin: this.startTime_begin ? `${this.startTime_begin}` : moment().subtract(7, 'days').format('YYYY-MM-DD'),
        startTime_end: this.startTime_end ? `${this.startTime_end}` : moment().format('YYYY-MM-DD'),
        dateFormat: 'YYYY-MM-DD',
        table1: {
          selectedRowKeys: [],
          selectionRows: [],
          loading: false,
          columns: [
            {
              title: '#',
              dataIndex: '',
              key: 'rowIndex',
              width: 60,
              align: 'center',
              customRender: function (t, r, index) {
                return parseInt(index) + 1
              },
            },
            {
              title: '资金申请单号',
              align: 'center',
              dataIndex: 'fundingApplicationNum',
            },
            {
              title: '供应商名称',
              align: 'center',
              dataIndex: 'vendorName'
            },
            {
              title: '单据类型',
              align: 'center',
              dataIndex: 'documentType_dictText',
            },
            {
              title: '所获物资',
              align: 'center',
              dataIndex: 'suppliesObtained',
            },
            {
              title: '申请金额',
              align: 'center',
              dataIndex: 'applicantAmount',
            },
            {
              title: '申请人',
              align: 'center',
              dataIndex: 'applyUserName',
            },
            {
              title: '申请日期',
              align: 'center',
              dataIndex: 'applicantDate',
            },
            {
              title: '账面金额',
              align: 'center',
              dataIndex: 'bookBalance',
            },
            {
              title: '批准金额',
              align: 'center',
              dataIndex: 'approveAmount',
            },
            {
              title: '财务查询人',
              align: 'center',
              dataIndex: 'financeUserName',
            },
            {
              title: '查询日期',
              align: 'center',
              dataIndex: 'queryDate',
            },
            {
              title: '制单人',
              align: 'center',
              dataIndex: 'createBy',
            },
            {
              title: '制单部门',
              align: 'center',
              dataIndex: 'sysOrgCode',
            },
            {
              title: '制单日期',
              align: 'center',
              dataIndex: 'createTime',
            },
            {
              title: '是否变更',
              align: 'center',
              dataIndex: 'isUpdate_dictText',
            },
            {
              title: '是否开启',
              align: 'center',
              dataIndex: 'isOpen_dictText',
            },
            {
              title: '操作',
              dataIndex: 'action',
              align: 'center',
              fixed: 'right',
              width: 147,
              scopedSlots: { customRender: 'action' }
            }
          ],
          dataSource: [],
          ipagination: {
            current: 1,
            pageSize: 3000,
            pageSizeOptions: ['100', '200', '3000'],
            showTotal: (total, range) => {
              return range[0] + '-' + range[1] + ' 共' + total + '条'
            },
            showQuickJumper: true,
            showSizeChanger: true,
            total: 0,
          },
        },
        notGeneratedTable: {
          loading: false,
          dataSource: [],
          // 表头
          ipagination: {
            current: 1,
            pageSize: 30,
            pageSizeOptions: ['10', '20', '30'],
            showTotal: (total, range) => {
              return range[0] + '-' + range[1] + ' 共' + total + '条'
            },
            showQuickJumper: true,
            showSizeChanger: true,
            total: 0
          }
        },
        needEditTable: {
          loading: false,
          dataSource: [],
          // 表头
          ipagination: {
            current: 1,
            pageSize: 30,
            pageSizeOptions: ['10', '20', '30'],
            showTotal: (total, range) => {
              return range[0] + '-' + range[1] + ' 共' + total + '条'
            },
            showQuickJumper: true,
            showSizeChanger: true,
            total: 0
          }
        },
        approvingTable: {
          loading: false,
          dataSource: [],
          // 表头
          ipagination: {
            current: 1,
            pageSize: 30,
            pageSizeOptions: ['10', '20', '30'],
            showTotal: (total, range) => {
              return range[0] + '-' + range[1] + ' 共' + total + '条'
            },
            showQuickJumper: true,
            showSizeChanger: true,
            total: 0
          }
        },
        approvedTable: {
          loading: false,
          dataSource: [],
          // 表头
          ipagination: {
            current: 1,
            pageSize: 30,
            pageSizeOptions: ['10', '20', '30'],
            showTotal: (total, range) => {
              return range[0] + '-' + range[1] + ' 共' + total + '条'
            },
            showQuickJumper: true,
            showSizeChanger: true,
            total: 0
          }
        },
        // 表头
        columns: [
          {
            title: '#',
            dataIndex: '',
            key:'rowIndex',
            width:60,
            align:"center",
            customRender:function (t,r,index) {
              return parseInt(index)+1;
            }
          },
          {
            title:'资金审批单号',
            align:"center",
            dataIndex: 'fundApprovalNum'
          },
          {
            title:'资金申请单号',
            align:"center",
            dataIndex: 'fundingApplicationNum'
          },
          {
            title:'供应商名称',
            align:"center",
            dataIndex: 'vendorName'
          },
          {
            title:'资金类别',
            align:"center",
            dataIndex: 'fundingCategory_dictText'
          },
          {
            title:'所获物资',
            align:"center",
            dataIndex: 'suppliesObtained'
          },
          {
            title:'币种',
            align:"center",
            dataIndex: 'currency_dictText'
          },
          {
            title:'批准金额',
            align:"center",
            dataIndex: 'endApprovalAmount'
          },
          {
            title:'请付金额',
            align:"center",
            dataIndex: 'pleasePayAmount'
          },
          {
            title:'申请人',
            align:"center",
            dataIndex: 'applyUserName'
          },
          {
            title:'申请日期',
            align:"center",
            dataIndex: 'applicantDate',
            customRender:function (text) {
              return !text?"":(text.length>10?text.substr(0,10):text)
            }
          },
          {
            title:'制单人',
            align:"center",
            dataIndex: 'createBy'
          },
          {
            title:'制单部门',
            align:"center",
            dataIndex: 'sysOrgCode'
          },
          {
            title:'制单日期',
            align:"center",
            dataIndex: 'createTime',
            customRender:function (text) {
              return !text?"":(text.length>10?text.substr(0,10):text)
            }
          },
          {
            title: '操作',
            dataIndex: 'action',
            align:"center",
            fixed:"right",
            width:147,
            scopedSlots: { customRender: 'action' }
          }
        ],
        url: {
          list: "/procurement/fundUseApproval/list",
          delete: "/procurement/fundUseApproval/delete",
          deleteBatch: "/procurement/fundUseApproval/deleteBatch",
          exportXlsUrl: "/procurement/fundUseApproval/exportXls",
          importExcelUrl: "procurement/fundUseApproval/importExcel",
          fundings: {
            list: "procurement/fundingApplication/list",
            close: "/procurement/fundingApplication/close"
          }
        },
        dictOptions:{},
        superFieldList:[],
      }
    },
    created() {
    this.getSuperFieldList();
    },
    computed: {
      importExcelUrl: function(){
        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
      },
    },
    methods: {
      handleDelete: function (id) {
        if (!this.url.delete) {
          this.$message.error("请设置url.delete属性!")
          return
        }
        var that = this;
        deleteAction(that.url.delete, {id: id}).then((res) => {
          if (res.success) {
            //重新计算分页问题
            that.reCalculatePage(1)
            that.$message.success(res.message);
            that.handleChangeTab();
          } else {
            that.$message.warning(res.message);
          }
        });
      },
      searchResetUnCreated() {
        this.startTime_begin = null
        this.startTime_end = null
        this.loadNotGeneratedData()
      },
      /**  取消流程申请 */
      handelSubmitCancel(row) {
        const params = {
          instanceId: row.processInstanceId
        }
        stopProcess(params).then((res) => {
          this.$message.success(res.message)
          this.loadApprovingData()
        })
      },
      handelFundingClose(record) {
        httpAction(this.url.fundings.close, record, 'put').then((res) => {
          if (res.success) {
            this.$message.success(res.message)
            this.loadFundingData()
          } else {
            this.$message.warning(res.message)
          }
        })
      },
      handleChangeTab() {
        switch (this.activeKey) {
          case 'wsc':
            this.loadFundingData()
            break
          case 'notGenerated':
            this.loadNotGeneratedData()
            break
          case 'needEdit':
            this.loadNeedEditData()
            break
          case 'approving':
            this.loadApprovingData()
            break
          case 'approved':
            this.loadApprovedData()
            break
          default:
            break
        }
      },
      loadFundingData() {
        this.tabIndex = 0
        let para = {
          ...this.queryParam,
          status: [999]
        }
        this.table1.loading = true
        getAction(this.url.fundings.list, para)
          .then((res) => {
            if (res.success) {
              this.table1.dataSource = res.result.records || res.result
              if (res.result.total) {
                this.table1.ipagination.total = res.result.total
              } else {
                this.table1.ipagination.total = 0
              }
            } else {
              this.$message.warning(res.message)
            }
          })
          .finally(() => {
            this.table1.loading = false
          })
      },
      loadNotGeneratedData() {
        //暂存中，status=-2
        this.tabIndex = 1
        const para = {
          ...this.queryParam,
          status: -2,
          ...(this.startTime_begin ? { createTimeBg: `${this.startTime_begin} 00:00:00` } : {}),
          ...(this.startTime_end ? { createTimeEd: `${this.startTime_end} 23:59:59` } : {}),
        }
        this.notGeneratedTable.loading = true
        getAction(this.url.list, para)
          .then((res) => {
            if (res.success) {
              this.notGeneratedTable.dataSource = res.result.records || res.result
              if (res.result.total) {
                this.ipagination.total = res.result.total
              } else {
                this.ipagination.total = 0
              }
            } else {
              this.$message.warning(res.message)
            }
          })
          .finally(() => {
            this.notGeneratedTable.loading = false
          })
      },
      //需修改
      loadNeedEditData() {
        this.tabIndex = 2
        //需修改单据，status=-1
        this.queryParam.status = -1
        this.needEditTable.loading = true
        getAction(this.url.list, this.queryParam)
          .then((res) => {
            if (res.success) {
              this.needEditTable.dataSource = res.result.records || res.result
              if (res.result.total) {
                this.needEditTable.ipagination.total = res.result.total
              } else {
                this.needEditTable.ipagination.total = 0
              }
            } else {
              this.$message.warning(res.message)
            }
          })
          .finally(() => {
            this.needEditTable.loading = false
          })
      },
      //审判中
      loadApprovingData() {
        this.tabIndex = 3
        //审核中单据，status=0
        this.queryParam.status = 0
        this.approvingTable.loading = true
        getAction(this.url.list, this.queryParam)
          .then((res) => {
            if (res.success) {
              this.approvingTable.dataSource = res.result.records || res.result
              if (res.result.total) {
                this.approvingTable.ipagination.total = res.result.total
              } else {
                this.approvingTable.ipagination.total = 0
              }
            } else {
              this.$message.warning(res.message)
            }
          })
          .finally(() => {
            this.approvingTable.loading = false
          })
      },
      //已审批
      loadApprovedData() {
        this.tabIndex = 4
        //已审核单据，status=999
        let para = {
          ...this.queryParam,
          status: 999
        }
        this.approvedTable.loading = true
        getAction(this.url.list, para)
          .then((res) => {
            if (res.success) {
              this.approvedTable.dataSource = res.result.records || res.result
              if (res.result.total) {
                this.approvedTable.ipagination.total = res.result.total
              } else {
                this.approvedTable.ipagination.total = 0
              }
            } else {
              this.$message.warning(res.message)
            }
          })
          .finally(() => {
            this.approvedTable.loading = false
          })
      },
      async loadData() {
        //分别根据单据状态查询结果并将其放在
        this.queryParam = this.getQueryParams()
        this.loadFundingData()
      },
      initDictConfig(){
      },
      printPreview(record) {
        let token = store.getters.token
        let id = record.id
        window.open(`${window._CONFIG['domianURL']}/jmreport/view/1080639438482915328?token=${token}&id=${id}`, '_blank')
      },
      getSuperFieldList(){
        let fieldList=[];
        fieldList.push({type:'string',value:'fundApprovalNum',text:'资金审批单号',dictCode:''})
        fieldList.push({type:'string',value:'approvalProcess',text:'审批流程',dictCode:''})
        fieldList.push({type:'int',value:'fundingCategory',text:'资金类别',dictCode:''})
        fieldList.push({type:'string',value:'financialInquirer',text:'财务查询人',dictCode:''})
        fieldList.push({type:'string',value:'currency',text:'币种',dictCode:''})
        fieldList.push({type:'string',value:'fundingApplicationNum',text:'资金申请单号',dictCode:''})
        fieldList.push({type:'string',value:'applicant',text:'申请人',dictCode:''})
        fieldList.push({type:'date',value:'applicantDate',text:'申请日期'})
        fieldList.push({type:'string',value:'capitalizedAmount',text:'合计（大写）',dictCode:''})
        this.superFieldList = fieldList
      },
      addNotice() {
        const rows = this.table1.selectionRows
        if (rows.length == 0) {
          this.$message.warn('请选择资金申请！')
          return
        }
        //
        this.$refs.modalForm.add(rows)
        this.$refs.modalForm.title = '新增'
        this.$refs.modalForm.disableSubmit = false
      },
      onSelectChangeTab1(selectedRowKeys, selectionRows) {
        this.table1.selectedRowKeys = selectedRowKeys
        this.table1.selectionRows = selectionRows
      },
      modalFormOk() {
        // 新增/修改 成功时，重载列表
        this.handleChangeTab()
        //清空列表选中
        this.onClearSelected()
      },
      searchQuery() {
        this.queryParam =[]
        this.loadNotGeneratedData()
      },
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less';
</style>